}
static void
-emit_window_activate (GtkAtSpiContext *self)
+emit_window_event (GtkAtSpiContext *self,
+ const char *event_type)
{
if (self->connection == NULL)
return;
NULL,
self->context_path,
"org.a11y.atspi.Event.Window",
- "activate",
+ event_type,
g_variant_new ("(siiva{sv})",
- "", 0, 0, g_variant_new_string("0"), NULL),
+ "", 0, 0,
+ g_variant_new_string("0"),
+ NULL),
NULL);
}
GTK_ACCESSIBLE_PLATFORM_STATE_ACTIVE);
emit_state_changed (self, "active", state);
- if (gtk_accessible_get_accessible_role (accessible) == GTK_ACCESSIBLE_ROLE_WINDOW && state)
- emit_window_activate (self);
+ /* Orca tracks the window:activate and window:deactivate events on top
+ * levels to decide whether to track other AT-SPI events
+ */
+ if (gtk_accessible_get_accessible_role (accessible) == GTK_ACCESSIBLE_ROLE_WINDOW)
+ {
+ if (state)
+ emit_window_event (self, "activate");
+ else
+ emit_window_event (self, "deactivate");
+ }
}
}